package InfoGroup
{	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	import Button.UglyTextField;
	
	public final class TrainInputData extends Sprite
	{		
		public var vMax  : UglyTextField; //En español
		public var acel  : UglyTextField;
		public var aFren : UglyTextField;
		public var aDer  : UglyTextField; 
		
		private var _title : TextField = new TextField();
		private var _titleFormat : TextFormat = new TextFormat();
		
		public function TrainInputData(title:String)
		{
			_titleFormat.size = 20;
			_titleFormat.bold;
			_titleFormat.align = TextFormatAlign.CENTER;
			_title.defaultTextFormat = _titleFormat;
			
			_title.text = title;
			
			addAllFields();
		}
		
		public function addAllFields() : void
		{
			vMax = new UglyTextField(TextFieldType.INPUT, 50, 50); //En español
			vMax.addLabel("Vel.Max", "Left");
			vMax.addLabel("Km/h", "Right");
			vMax.setText("0");			
			vMax.allowSymbol(".");
			
			acel = new UglyTextField(TextFieldType.INPUT, 50, vMax.getPos().y + 50);
			acel.addLabel("Aceleracion", "Left");
			acel.addLabel("M/S2", "Right");
			acel.setText("0");
			acel.allowSymbol(".");
			
			aFren = new UglyTextField(TextFieldType.INPUT, 50, acel.getPos().y + 50);
			aFren.addLabel("Acel.Fren", "Left");
			aFren.addLabel("M/S2", "Right");
			aFren.setText("0");
			aFren.allowSymbol(".");
			aFren.allowSymbol("-");
			
			aDer = new UglyTextField(TextFieldType.INPUT, 50, aFren.getPos().y + 50);
			aDer.addLabel("Acel.Der", "Left");
			aDer.addLabel("M/S2", "Right");
			aDer.setText("0");
			aDer.allowSymbol(".");
			aDer.allowSymbol("-");
			
			addChild(acel);
			addChild(vMax);
			addChild(aFren);
			addChild(aDer);
			
			addChild(_title);
		}
	}
}